
using System;
using System.Collections;
using System.Web.UI.WebControls;

using Awaken.Framework;
using Nullables;

namespace Northwind.Domain.Entities
{
    public partial class CustomerDemographic : IEntity
    {
        protected static CustomerDemographicBroker broker;
        public static CustomerDemographicBroker Broker
        {
            get
            {
                if (broker == null)
                {
                    broker = new CustomerDemographicBroker();
                }
                return broker;
            }
        }

        #region IEntity Members

        public string EntityID
        {
            get { return string.Empty; }
        }
        
        public string EntityName
        {
            get { return string.Empty; }
        }

        public void Save()
        {
            Broker.Save(this);
        }
        
        public void Delete()
        {
            Broker.Delete(this);
        }
        
        #endregion
    
        #region Constructor
        
        public CustomerDemographic()
        {
            // Default, no arg constructor.
        }
        
        #endregion
            
        #region Public Properties / Protected Fields
                        
        
        protected string _CustomerTypeID;
        public string CustomerTypeID
        {
            get{ return _CustomerTypeID; }
            set{ _CustomerTypeID=value; }
        }
        
        protected string _CustomerDesc;
        public string CustomerDesc
        {
            get{ return _CustomerDesc; }
            set{ _CustomerDesc=value; }
        }
        
        
        
        
                
        
        
        // Many-To-Many: CustomerCustomerDemo
        protected IList _CustomerList;
        public IList CustomerList
        {
            get{ return _CustomerList; }
            set{ _CustomerList=value; }
        }
        
        
        #endregion
    }
    
    #region CustomerDemographicBroker

    public partial class CustomerDemographicBroker : IBroker
    {
        #region IBroker Members

        public Type EntityType
        {
            get { return typeof(CustomerDemographic); }
        }
        
        public CustomerDemographic GetByID(object id)
        {
            return (CustomerDemographic)Awaken.Framework.Gateway.GetByID(EntityType, id);
        }

        public IList GetAll()
        {
            return Awaken.Framework.Gateway.GetAll(EntityType);
        }

        public void Save(IEntity entity)
        {
            Awaken.Framework.Gateway.Save(entity);
        }
        
        public void Delete(IEntity entity)
        {
            Awaken.Framework.Gateway.Delete(entity);
        }
        
        #endregion
    }
    #endregion
}
